package it.rap.application.logic.mappers.asp;

import it.rap.applications.persistence.entities.movimento.Movimento;

import java.util.List;
import java.util.logging.Logger;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;

@Aspect
public class MovimentoLogicAsp {
	
	Logger logger = Logger.getLogger( this.getClass().getSimpleName() );
	//Logger logger = new Logger();
	
	@AfterReturning( pointcut = "execution(public * it.rap.application.logic.mappers.MovimentoLogic.selectAll(..))", returning = "m")
    public void afterReturning(JoinPoint jp, List<Movimento> m){
		logger.info( "#S# AfterReturning " + jp.getSignature().getName());
		for (Movimento movimento : m) {
			logger.info( "#######################################");
			logger.info(  movimento.toString() );	
			logger.info( "#######################################");			
		}
	    logger.info( "#E# AfterReturning " + jp.getSignature().getName());
    } 

}
